package cn.jvav.zh.io;

public class ConsoleIO{
	static{
		//javac ConsoleIO.java -h ./
		//g++ console_IO.cpp -o console_IO.dll -fPIC -shared -I"C:\Users\Administrator\.jdks\corretto-17.0.6\include" -I"C:\Users\Administrator\.jdks\corretto-17.0.6\include\win32"
		System.loadLibrary("console_IO");
	}

	// 无缓冲无回显输入
	public static native int getch();

	// 清屏
	public static void clearScreen(){
		try{
			new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
		}catch(Exception e){
			throw new RuntimeException(e);
		}
	}
}
